package employe;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

public class Main {

	private Main() {
		super();
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		/*Employe e = new Employe("Mc Intyre", "Laura", "Britannique", 45000.5);
		try {
			FileOutputStream f = new FileOutputStream("employe.dat");
			try {
				ObjectOutputStream oos = new ObjectOutputStream(f);
				oos.writeObject(e);
				oos.flush();
				oos.close();
			} catch (IOException e1) {
				e1.printStackTrace();
			}
		} catch (FileNotFoundException e1) {
			e1.printStackTrace();
		}*/

		try {
			FileInputStream fi = new FileInputStream("employe.dat");
			try {
				ObjectInputStream ois = new ObjectInputStream(fi);
				Employe ee = (Employe) ois.readObject();
				System.out.println(ee.toString());
				System.out.println(ee.getPays());

				ois.close();
			} catch (IOException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			} catch (ClassNotFoundException cnf) {
				// TODO Auto-generated catch block
				cnf.printStackTrace();
			}
		} catch (FileNotFoundException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}

	}

} // Fin Main
